function plotUnconditionalMoments(momentsModel_input,momentsData_input)
FontSizeValue = 12;
lineWidthValue = 2.5;
markerSizeValue = 10;

% Any value of h will do for the unconditonal means and stds
momentsModel = momentsModel_input.h6;
momentsData  = momentsData_input.h6;

figure('Name','Unconditional moments','NumberTitle','off')
% The mean of the yield curve
subplot(2,2,1)
hold on 
plot(momentsData.maturities/12,momentsData.meanYield,'-k')
plot(momentsModel.maturities/12,momentsModel.meanYield,'-xk','MarkerSize',markerSizeValue)
plot(momentsData.maturities/12,momentsModel.meanYield+1.96*momentsData.meanYield_bootSE,'--k')
plot(momentsData.maturities/12,momentsModel.meanYield-1.96*momentsData.meanYield_bootSE,'--k')
axis tight
xlabel('Maturity in years','FontSize',FontSizeValue)
set(gca,'FontSize',FontSizeValue)
legend({'Data','Model'},'Orientation','horizontal',...
                'Position',[0.234558531746033 0.959920634920635 0.117291666666667 0.0331632653061225],...
                'FontSize',FontSizeValue)
hold off
title('Mean of bond yields')

% The mean the yield curve: regime
subplot(2,2,2)
hold on 
plot(momentsData.maturities/12,momentsData.meanYield_regime1,'-b')
plot(momentsModel.maturities/12,momentsModel.meanYield_regime1,'-xb','MarkerSize',markerSizeValue)
plot(momentsData.maturities/12,momentsData.meanYield_regime2,'-r','LineWidth',lineWidthValue)
plot(momentsModel.maturities/12,momentsModel.meanYield_regime2,'-xr','LineWidth',lineWidthValue,'MarkerSize',markerSizeValue)
plot(momentsData.maturities/12,momentsData.meanYield_regime1+1.96*momentsData.meanYield_regime1_bootSE,'--b')
plot(momentsData.maturities/12,momentsData.meanYield_regime1-1.96*momentsData.meanYield_regime1_bootSE,'--b')
plot(momentsData.maturities/12,momentsData.meanYield_regime2+1.96*momentsData.meanYield_regime2_bootSE,'--r')
plot(momentsData.maturities/12,momentsData.meanYield_regime2-1.96*momentsData.meanYield_regime2_bootSE,'--r')

xlabel('Maturity in years','FontSize',FontSizeValue)
set(gca,'FontSize',FontSizeValue)
axis tight
legend({'Data: Boom','Model: Boom','Data: Recession','Model: Recession'},'Orientation','horizontal',...
                'Position',[0.544454365079364 0.96374716553288 0.38625 0.0331632653061225],...
                'FontSize',FontSizeValue)
hold off
title('Mean of bond yields: Regime-dependent')


% The volatility of the yield curve
subplot(2,2,3)
hold on 
plot(momentsData.maturities/12,momentsData.stdYield,'-k')
plot(momentsModel.maturities/12,momentsModel.stdYield,'-xk','MarkerSize',markerSizeValue)
plot(momentsData.maturities/12,momentsData.stdYield+1.96*momentsData.stdYield_bootSE,'--k')
plot(momentsData.maturities/12,momentsData.stdYield-1.96*momentsData.stdYield_bootSE,'--k')
axis tight
xlabel('Maturity in years','FontSize',FontSizeValue)
set(gca,'FontSize',FontSizeValue)
hold off
title('Std of bond yields')


% The volatility of the yield curve: regime dependend
subplot(2,2,4)
hold on 
plot(momentsData.maturities/12,momentsData.stdYield_regime1,'-b')
plot(momentsData.maturities/12,momentsModel.stdYield_regime1,'-xb','MarkerSize',markerSizeValue)
plot(momentsData.maturities/12,momentsData.stdYield_regime2,'-r','LineWidth',lineWidthValue)
plot(momentsData.maturities/12,momentsModel.stdYield_regime2,'-xr','LineWidth',lineWidthValue,'MarkerSize',markerSizeValue)
plot(momentsData.maturities/12,momentsData.stdYield_regime1+1.96*momentsData.stdYield_regime1_bootSE,'--b')
plot(momentsData.maturities/12,momentsData.stdYield_regime1-1.96*momentsData.stdYield_regime1_bootSE,'--b')
plot(momentsData.maturities/12,momentsData.stdYield_regime2+1.96*momentsData.stdYield_regime2_bootSE,'--r')
plot(momentsData.maturities/12,momentsData.stdYield_regime2-1.96*momentsData.stdYield_regime2_bootSE,'--r')
axis tight
xlabel('Maturity in years','FontSize',FontSizeValue)
set(gca,'FontSize',FontSizeValue)
hold off
title('Std of bond yields: Regime-dependent')

%% Persistence plot
figure('Name','Percistency of bond yields','NumberTitle','off')

subplot(2,1,1)
hold on
plot(momentsData.AR1_regime.maturities/12,momentsData.AR1_regime.bettaHat(:,3),'-b')
plot(momentsModel.AR1_regime.maturities/12,momentsModel.AR1_regime.bettaHat(:,3),'-xb','MarkerSize',markerSizeValue)
plot(momentsData.AR1_regime.maturities/12,...
    momentsData.AR1_regime.bettaHat(:,3)+1.96*momentsData.AR1_regime.seBettaHat(:,3),'--b')
plot(momentsData.AR1_regime.maturities/12,...
    momentsData.AR1_regime.bettaHat(:,3)-1.96*momentsData.AR1_regime.seBettaHat(:,3),'--b')
hold off
axis tight
xlabel('Maturity in years','FontSize',FontSizeValue)
set(gca,'FontSize',FontSizeValue)
title('Persistence in expansions')
legend({'Data','Model'},'Orientation','horizontal',...
                'Position',[0.544454365079364 0.96374716553288 0.38625 0.0331632653061225],...
                'FontSize',FontSizeValue)


subplot(2,1,2)
hold on
plot(momentsData.AR1_regime.maturities/12,momentsData.AR1_regime.bettaHat(:,4),'-r')
plot(momentsModel.AR1_regime.maturities/12,momentsModel.AR1_regime.bettaHat(:,4),'-xr','MarkerSize',markerSizeValue)
plot(momentsData.AR1_regime.maturities/12,...
    momentsData.AR1_regime.bettaHat(:,4)+1.96*momentsData.AR1_regime.seBettaHat(:,4),'--r')
plot(momentsData.AR1_regime.maturities/12,...
    momentsData.AR1_regime.bettaHat(:,4)-1.96*momentsData.AR1_regime.seBettaHat(:,4),'--r')
plot(momentsData.AR1_regime.maturities/12,momentsData.AR1_regime.bettaHat(:,4)*0,'--k')
axis tight
xlabel('Maturity in years','FontSize',FontSizeValue)
set(gca,'FontSize',FontSizeValue)
title('Change in persistence during recessions')

%% Plot GIRFs
GIRFs = momentsModel_input.GIRFs;
matPlot = 120;

figure('Name','GIRFs xhr','NumberTitle','off')
varNames = {'Shock to: Inflation ','Shock to: Output','Shock to: Inflation weight','Shock to: Output weight'};
idx = 0;
for i=1:4
    idx = idx + 1;
    subplot(2,2,idx)
    hold on
    plot(100*squeeze(GIRFs.IRFxhr_1(matPlot==GIRFs.matSelect,i,:)),'-b')
    plot(100*squeeze(GIRFs.IRFxhr_2(matPlot==GIRFs.matSelect,i,:)),'-r')
    hold off
    ylabel('pct')
    title(varNames{idx})
end


figure('Name','GIRFs x','NumberTitle','off')
idx = 0;
for i=1:4
    for j=1:4
        idx = idx + 1;
        subplot(4,4,idx)
        hold on
        plot(squeeze(GIRFs.IRFx_1(j,i,:)),'-b')
        plot(squeeze(GIRFs.IRFx_2(j,i,:)),'-r')
        title(['shock to x(',num2str(i),',1): Effect on x(',num2str(j),',1)'])
        hold off
    end
end

figure('Name','GIRFs slope','NumberTitle','off')
idx = 0;
for i=1:4
    idx = idx + 1;
    subplot(2,2,idx)
    hold on
    plot(100*squeeze(GIRFs.IRFy_1(matPlot==GIRFs.matSelect,i,:))-100*squeeze(GIRFs.IRFy_1(3,i,:)),'-b')
    plot(100*squeeze(GIRFs.IRFy_2(matPlot==GIRFs.matSelect,i,:))-100*squeeze(GIRFs.IRFy_2(3,i,:)),'-r')
    ylabel('pct')
    hold off
end

%% Chart for recessions
momentsModelh1 = momentsModel_input.h1;
momentsDatah1  = momentsData_input.h1;
matPlot = 120;
figure('Name','Recession Analysis','NumberTitle','off')
subplot(2,2,1)
axis tight
hold on
plot(momentsDatah1.meanXhrAfterRecStart(matPlot,:)*100,'-k')
plot(momentsDatah1.meanXhrAfterRecStart(matPlot,:)*100-1.96*momentsDatah1.meanXhrAfterRecStartSE(matPlot,:)*100,'--k')
plot(momentsDatah1.meanXhrAfterRecStart(matPlot,:)*100+1.96*momentsDatah1.meanXhrAfterRecStartSE(matPlot,:)*100,'--k')
plot(momentsModelh1.meanXhrAfterRecStart(matPlot,:)*100,'-ok')
title(['Average Level of ',num2str(matPlot/12),'-year Excess Returns in Recessions'])
axis tight
subplot(2,2,2)   
hold on
plot(momentsDatah1.meanTermSpreadAfterRecStart(matPlot,:)*100,'-k')
plot(momentsDatah1.meanTermSpreadAfterRecStart(matPlot,:)*100+1.96*momentsDatah1.meanTermSpreadAfterRecStartSE(matPlot,:)*100,'--k')
plot(momentsDatah1.meanTermSpreadAfterRecStart(matPlot,:)*100-1.96*momentsDatah1.meanTermSpreadAfterRecStartSE(matPlot,:)*100,'--k')
plot(momentsModelh1.meanTermSpreadAfterRecStart(matPlot,:)*100,'-ok')
title(['Average Level of ',num2str(matPlot/12),'-year Term Spread in Recessions'])
axis tight

YMIN = 1.5*min([momentsDatah1.meanDyieldsAfterRecStart(3,:)*100   ,momentsModelh1.meanDyieldsAfterRecStart(3,:),...
            momentsDatah1.meanDyieldsAfterRecStart(matPlot,:)*100 ,momentsModelh1.meanDyieldsAfterRecStart(matPlot,:)]);
YMAX = 0.1+max([momentsDatah1.meanDyieldsAfterRecStart(3,:)*100   ,momentsModelh1.meanDyieldsAfterRecStart(3,:),...
            momentsDatah1.meanDyieldsAfterRecStart(matPlot,:)*100 ,momentsModelh1.meanDyieldsAfterRecStart(matPlot,:)]);
subplot(2,2,3)          
hold on
plot(momentsDatah1.meanDyieldsAfterRecStart(3,:)*100,'-k')
plot(momentsDatah1.meanDyieldsAfterRecStart(3,:)*100-1.96*momentsDatah1.meanDyieldsAfterRecStartSE(3,:)*100,'--k')
plot(momentsDatah1.meanDyieldsAfterRecStart(3,:)*100+1.96*momentsDatah1.meanDyieldsAfterRecStartSE(3,:)*100,'--k')
plot(momentsModelh1.meanDyieldsAfterRecStart(3,:)*100,'-ok')
title('Average Change in 3-month Bond Yields in Recessions')
axis([1 size(momentsDatah1.meanDyieldsAfterRecStart(matPlot,:),2) YMIN YMAX])

subplot(2,2,4)          
hold on
plot(momentsDatah1.meanDyieldsAfterRecStart(matPlot,:)*100,'-k')
plot(momentsDatah1.meanDyieldsAfterRecStart(matPlot,:)*100-1.96*momentsDatah1.meanDyieldsAfterRecStartSE(matPlot,:)*100,'--k')
plot(momentsDatah1.meanDyieldsAfterRecStart(matPlot,:)*100+1.96*momentsDatah1.meanDyieldsAfterRecStartSE(matPlot,:)*100,'--k')
plot(momentsModelh1.meanDyieldsAfterRecStart(matPlot,:)*100,'-ok')
title(['Average Change in ',num2str(matPlot/12),'-year Bond Yields in Recessions'])
axis([1 size(momentsDatah1.meanDyieldsAfterRecStart(matPlot,:),2) YMIN YMAX])
    
    


end